-- background: 2643 from stack: in.4 -- bmap block id: 2285 -- flags: 4000 -- background id: 0 -- name: Income ----- HyperTalk script ----- on copyright -- THESE SCRIPTS ARE COPYRIGHTED BY MAC HELP COMPANY -- CONTACT AUTHOR FOR PERMISSION TO USE THESE SCRIPTS end copyright on openbackground Global GivingDate if GivingDate is empty then put the long date into GivingDate end openbackground on opencard Global RegMessage, DoMessage, VersionMessage put card field "Sub Accounts" of card "a" of background "a" into background field "Sub Accounts" put "Miscellaneous" into background field ID 91 if DoMessage is not False then play boing a answer VersionMessage & "See where to Register or Continue?" with "Continue" or "See" if it is "See" then answer RegMessage with "Good Deal" end if end opencard on continueD global LName, ThisButton, donation, Givingdate, shortgivingdate Global NextLine put ThisButton into word 6 of line NextLine of background field "Record of Giving" push card set numberformat to 0.00 go to card ShortGivingDate of background "Daily1" add donation to background field ThisButton if ThisButton is "General Fund" then add donation to background field "General Income" else add donation to background field "Designated Income" end if go to this card pop card put false into flag repeat until flag ask "Enter name of Donor?" with LName if it is "" then exit continueD if it is LName then put True into Flag else set loc of message box to 20,-50 put "Find " & NumToChar(34) & it & NumToChar(34) into message box hide message box set loc of message box to 20,300 do message box put background field "Last Name" into Temp answer "Donor's Last Name: " & Temp with "Cancel" or "Look Again" or "Yes" if it is "Cancel" then exit continueD if it is "Yes" then put true into flag if it is "No" then put false into flag end if end repeat click at the loc of background button "Donation Entry" end continueD on closeCard put empty into background field "Sub Accounts" end CloseCard on ButtonLight Global ThisField, ThisLine, ReturnFromSub put the scroll of background field "Sub Accounts" / the textHeight of background field "Sub Accounts" into HiddenLines put the round of HiddenLines into HiddenLines put HiddenLines + ThisLine into LineNumber get line LineNumber of background field "Sub Accounts" put it into SubName If the optionKey is Down then put the ID of this card into ReturnFromSub go to card SubName show background button "Return" set hilite of background button "Return" to true set hilite of background button "Return" to False set hilite of background button "Return" to true else send "CloseField" to background field "Amount" get background field "Amount" if it is empty then answer "First enter an amount of income!" click at the loc of background field "Amount" exit "ButtonLight" end if if ThisField > 86 and ThisField < 92 then put SubName into background field ID ThisField put ThisField+5 into Temp if background field ID Temp is empty then get background field ID 96 put it into background field ID temp put "0.00" into background field id 96 end if else repeat with i = 87 to 91 if background field ID i is empty then put SubName into background field ID i if i < 91 then put i+5 into temp get background field ID 96 put it into background field ID temp put "0.00" into background field id 96 end if exit repeat end if end repeat end if end if end ButtonLight on "CreditSubs" Global ShortGivingDate set numberformat to 0.00 put the ID of this card into ThisID repeat with i = 87 to 91 put background field id i into SubName put i+5 into SubAmtID get background field id SubAmtID put it into Amount if Amount is not empty then if SubName is not empty then put the value of Amount into SubAmt go to card SubName of background "Sub Accounts" put 0 into i repeat forever add 1 to i get line i of background field "Sub Amount2" if it is empty then put shortGivingDate & " $ " & SubAmt into line i of background field "Sub Amount2" exit repeat else if word 1 of it is shortGivingDate then put word 3 of it into Balance add SubAmt to Balance put shortGivingDate & " $ " & Balance into line i of background field "Sub Amount2" exit repeat end if end if end repeat add SubAmt to background field "Sub Total2" go to ThisID end if end if end repeat end "CreditSubs" on "ResetFields" put empty into background field "Amount" put empty into background field id 87 put empty into background field id 88 put empty into background field id 89 put empty into background field id 90 put "Miscellaneous" into background field id 91 put empty into background field id 92 put empty into background field id 93 put empty into background field id 94 put empty into background field id 95 put empty into background field id 96 end "ResetFields" -- part 25 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=12 top=38 right=60 bottom=38 -- title width / last selected line: 0 -- icon id / first selected line: 26635 / 26635 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Income Entry ----- HyperTalk script ----- on mouseUp Global GivingDate, ShortGivingDate, YTDIncome, ThisButton, LName global donation, NextLine, Action, Amount, ExitFlag, DatePhrase Global ForSure, LastID, CheckLName if the optionKey is down then put "This button allows you to search for the key name you have" && "entered. It is more useful than the find button because it will" && "only find the information in the key name field." into String put the name of the target into ThisItem HelpMsg2 String, ThisItem exit mouseUp end if set numberformat to 00.00 put background field "Last Name" into LName if CheckLName is empty then put LName into CheckLName end if put False into Flag put False into ExitFlag put False into ForSure set cursor to 4 repeat until Flag if ExitFlag is True then exit mouseUp end if if exitFlag is "amount" then click at the loc of background field "Amount" exit mouseUp end if if ForSure is False then ask "Income Source." with CheckLName else put False into ForSure put LName into it end if if it is empty then -- CHECK IF DATE NEEDS TO BE SET exit mouseUp put "Do you wish to change the date of this entry from: " into DatePhrase put False into ExitFlag send "DoDate" to background if exitFlag is true then exit mouseUp end if else -- A NAME IS ENTERED put it into CheckLName --if it is LName then -- IF IT IS THIS NAME --set lockscreen to true --exit mouseUp --else -- LOOK FOR A DIFFERENT NAME FIRST set lockscreen to true go to next card of this background put CheckLName into LName put false into ExitFlag "CheckLast" if exitFlag is "amount" then click at the loc of background field "Amount" exit mouseUp end if if exitFlag is "New" then set lockscreen to false click at the loc of background button "New" exit mouseUp end if --end if end if end repeat end mouseUp on "CheckLast" Global LName, ExitFlag, ForSure set loc of message window to 20, -300 put "Find " & NumToChar(34) & LName & NumToChar(34) & " in field 15" into message box hide message box set loc of message window to 20, 300 do message window put the ID of this card into CheckCardID put 0 into Repeated repeat forever-- CHECK TO MAKE SURE NO DUPLICATE LAST NAME if background field "Last Name" contains LName then put background field "Last Name" into PossibleLName if the ID of this card is CheckCardID then add 1 to Repeated if Repeated > 1 then beep "NewName" exit repeat end if end if put PossibleLName into Temp set lockscreen to false play boing a put False into never -- ** put "Amount" into ExitFlag -- ** exit checkLast -- ** if Never is True then -- ** CAN REMOVE TO ASK Question answer "Is this the income source: " & Temp & "?" with "CANCEL" or "Look Again" or "Yes" if it is "Cancel" then put true into ExitFlag exit repeat end if if it is "Look Again" then set lockscreen to true do message window end if if it is "Yes" then put Temp into LName put True into ForSure put "amount" into ExitFlag exit repeat end if end if else "NewName" exit repeat end if end repeat end "CheckLast" on "NewName" Global LName, ExitFlag beep answer "No record of '" & LName & "' was found! " & "Do you wish to create a new record?" with "Yes" or "No" if it is "No" then put True into ExitFlag exit "NewName" else put "New" into ExitFlag end if end "NewName" -- part 27 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=389 top=287 right=328 bottom=428 -- title width / last selected line: 0 -- icon id / first selected line: 9301 / 9301 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Preview ----- HyperTalk script ----- on mouseUp visual effect scroll right go to previous card of this background end mouseUp -- part 28 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=425 top=287 right=328 bottom=464 -- title width / last selected line: 0 -- icon id / first selected line: 27009 / 27009 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp visual effect scroll left go to next card of this background end mouseUp -- part 29 (button) -- low flags: 00 -- high flags: 8004 -- rect: left=290 top=288 right=329 bottom=329 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New ----- HyperTalk script ----- on mouseUp set hilite of background button New to true --answer "Do you wish to make a new card?" with "Yes" or "NO" put "yes" into it --Don't even need to ask if it is "Yes" then doMenu New Card put the long date into line 1 of background field "Creation Date" put the seconds into line 2 of background field "Creation Date" end if set hilite of background button New to false click at the loc of background field "First Names" end mouseUp -- part 30 (button) -- low flags: 00 -- high flags: A004 -- rect: left=332 top=288 right=329 bottom=371 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Del. ----- HyperTalk script ----- on mouseUp answer "Are you sure you want to delete this Income account?" with "Yes" or "NO" if it is "Yes" then set lockscreen to true doMenu Delete Card go to previous card of background "Income" play harpsichord a c if the number of cards = 1 then put the number of this card & " of " & the number of cards into background field "Card Info" end if end if set lockscreen to false end mouseUp -- part 31 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=247 top=288 right=329 bottom=286 -- title width / last selected line: 0 -- icon id / first selected line: 20186 / 20186 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort ----- HyperTalk script ----- on mouseUp global LastField, LastLine if LastLine is 0 then put 1 into LastLine set lockscreen to true push card put LastField into AskField answer "Sort all Income Source cards according to:" with AskField or "Other" or "CANCEL" if it is "Cancel" then exit mouseUp if it is AskField then sort by background field AskField end if if it is "Other" then answer "Sort all Income Source cards according to:" with "As Entered" or "Last Entered" or "CANCEL" if it is "Last Entered" then sort descending by line 2 of background field "Creation Date" go to Last Card end if if it is "As Entered" then sort by line 2 of background field "Creation Date" if it is "Cancel" then exit mouseUp end if pop card go to card "Main" of this background set lockscreen to false end mouseUp -- part 35 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=117 top=288 right=329 bottom=156 -- title width / last selected line: 0 -- icon id / first selected line: 1007 / 1007 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ImageWriter ----- HyperTalk script ----- on mouseUp Global Report, ClearedActivity, LastID answer "Do these cards need to be sorted before printing?" with "CANCEL" or "No" or "Sort" if it is "CANCEL" then exit mouseUp if it is "Sort" then click at the loc of background button sort answer "How would you like to print?" with "Print Report" or "Actual Cards" or "CANCEL" if it is "CANCEL" then pass mouseUp set lockscreen to true if it is "Print Report" then doMenu "Page Setup..." set Lockscreen to True doMenu "Print Report..." end if if it is "Actual Cards" then answer "How would you like to print?" with "This client" or "All Clients" or "CANCEL" if it = "Cancel" then pass mouseUp if it = "This client" then open printing print this card end if if it = "All Clients" then push card set lockscreen to true go to last card of this background put the number of this card into LastCard go to first card of this background put the number of this card into FirstCard put LastCard-FirstCard+1 into HowMany open printing with dialog Print HowMany Cards close printing pop card end if end if close printing set lockscreen to false end mouseUp -- part 37 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=0 top=0 right=15 bottom=250 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 2304 -- line height: 13 -- part name: Creation Date -- part 41 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=35 top=111 right=128 bottom=58 -- title width / last selected line: 0 -- icon id / first selected line: 30696 / 30696 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp get the selection if it is empty then get background field "Phone" if it is empty then ask "Dial what number?" if it is not empty then push this card visual effect zoom open go to stack "Phone" dial it pop card end if end mouseUp -- part 47 (button) -- low flags: 80 -- high flags: A005 -- rect: left=339 top=90 right=110 bottom=490 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sunday School ----- HyperTalk script ----- on mouseUp Global ThisButton put "Sunday School" into ThisButton set hilite of background button ThisButton to false repeat with i = 47 to 55 hide background button id i end repeat hide background field "Blank Pop Card" end mouseUp -- part 86 (field) -- low flags: 01 -- high flags: 4007 -- rect: left=309 top=139 right=268 bottom=498 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 14 -- part name: Sub Accounts ----- HyperTalk script ----- on mouseUp Global ThisItem, ThisField, ReturnFromSub set numberformat to 0 put the ClickLoc into ThisMouseLoc set cursor to 4 -- This script written and copyrighted by: Christopher C. Hostetter -- Mac Help Company, 1800 East Market St., Long Beach, CA 90805 -- (213) 428-7414 -- This script may be freely modified and used in other stacks, -- but these five credit lines must accompany this script. put the name of the target into WhatField put the rect of whatField into FieldRect put item 1 of FieldRect into X -- Left of Rect put item 2 of FieldRect into Y -- Top of Rect put item 3 of FieldRect into XX -- Right of Rect put item 4 of FieldRect into YY -- Bottom of Rect put (YY - Y) / the textheight of whatField into TotalZones put (YY - Y) / TotalZones into ZoneDepth put item 2 of ThisMouseLoc - Y into MouseDepth put the trunc of ((MouseDepth / ZoneDepth) + 1) into whichZone put the scroll of whatField / the textHeight of whatField into HiddenLines put the round of (whichZone + HiddenLines) into ThisLine do "put line" && ThisLine && "of" && whatField && "into ThisItem" --MOVE HILIGHTER BUTTON TO PROPER ZONE put Y + ((whichZone-1)*ZoneDepth) into ButY put the trunc of ButY into ButY put the trunc of (ButY+ZoneDepth) into ButYY if the style of whatField is "Scrolling" then set the rect of background button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1 else set the rect of background button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1 end if show background button "Hilighter" set lockscreen to true -- Use information from ThisItem in the sub fields put ThisItem into SubName if the ShiftKey is down then Hide background button "Hilighter" put the ID of this card into ReturnFromSub go to card SubName show background button "return" set hilite of background button "Return" to True set hilite of background button "Return" to False set hilite of background button "Return" to True exit mouseUp end if set numberFormat to 0.00 if background field "Amount" is empty then Hide background button "Hilighter" answer "First enter an amount of income!" click at the loc of background field "Amount" exit "mouseUp" end if repeat with i = 87 to 91 if background field ID i is empty then put i into ThisField put SubName into background field ID i if i < 91 then put i+5 into temp if background field ID Temp is empty then put temp into SubAmtID get background field ID 96 put it into background field ID temp put "0.00" into background field id 96 end if end if exit repeat end if end repeat Hide background button "Hilighter" set lockscreen to false put ThisField+5 into Temp if Temp > 86 then click at the loc of background field ID Temp click at the loc of background field ID Temp end if end mouseUp -- part 87 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=12 top=202 right=216 bottom=149 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub1 ----- HyperTalk script ----- on openfield global thisField put 87 into thisField end openfield on closefield Global ThisField put False into Flag get background field id ThisField put it into ThisString find it in background field "Sub Accounts" put 0 into Test put 0 into Total put 0 into LineNumber repeat until Flag add 1 to LineNumber put length of line LineNumber of background field "Sub Accounts" into Len add 1 to Len put Len + Total into Total put offset (it, background field "Sub Accounts") into ThisOffset if ThisOffset < Total then --ask "Is this the line? " with LineNumber get line LineNumber of background field "Sub Accounts" if it is ThisString then exit CloseField else ask "Do you mean..." with it if it is "" then beep click at the loc of background field id ThisField exit closeField else put it into background field id ThisField put True into Flag end if end if end if end repeat end closefield -- part 88 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=12 top=215 right=229 bottom=149 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub2 ----- HyperTalk script ----- on openfield global thisField put 88 into thisField end openfield on closefield Global ThisField put False into Flag get background field id ThisField put it into ThisString find it in background field "Sub Accounts" put 0 into Test put 0 into Total put 0 into LineNumber repeat until Flag add 1 to LineNumber put length of line LineNumber of background field "Sub Accounts" into Len add 1 to Len put Len + Total into Total put offset (it, background field "Sub Accounts") into ThisOffset if ThisOffset < Total then --ask "Is this the line? " with LineNumber get line LineNumber of background field "Sub Accounts" if it is ThisString then exit CloseField else ask "Do you mean..." with it if it is "" then beep click at the loc of background field id ThisField exit closeField else put it into background field id ThisField put True into Flag end if end if end if end repeat end closefield -- part 89 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=12 top=228 right=242 bottom=149 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub3 ----- HyperTalk script ----- on openfield global thisField put 89 into thisField end openfield on closefield Global ThisField put False into Flag get background field id ThisField put it into ThisString find it in background field "Sub Accounts" put 0 into Test put 0 into Total put 0 into LineNumber repeat until Flag add 1 to LineNumber put length of line LineNumber of background field "Sub Accounts" into Len add 1 to Len put Len + Total into Total put offset (it, background field "Sub Accounts") into ThisOffset if ThisOffset < Total then --ask "Is this the line? " with LineNumber get line LineNumber of background field "Sub Accounts" if it is ThisString then exit CloseField else ask "Do you mean..." with it if it is "" then beep click at the loc of background field id ThisField exit closeField else put it into background field id ThisField put True into Flag end if end if end if end repeat end closefield -- part 90 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=12 top=241 right=255 bottom=149 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub4 ----- HyperTalk script ----- on openfield global thisField put 90 into thisField end openfield on closefield Global ThisField put False into Flag get background field id ThisField put it into ThisString find it in background field "Sub Accounts" put 0 into Test put 0 into Total put 0 into LineNumber repeat until Flag add 1 to LineNumber put length of line LineNumber of background field "Sub Accounts" into Len add 1 to Len put Len + Total into Total put offset (it, background field "Sub Accounts") into ThisOffset if ThisOffset < Total then --ask "Is this the line? " with LineNumber get line LineNumber of background field "Sub Accounts" if it is ThisString then exit CloseField else ask "Do you mean..." with it if it is "" then beep click at the loc of background field id ThisField exit closeField else put it into background field id ThisField put True into Flag end if end if end if end repeat end closefield -- part 91 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=12 top=254 right=268 bottom=149 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub5 ----- HyperTalk script ----- on openfield global thisField put 91 into thisField end openfield on closefield Global ThisField put False into Flag get background field id ThisField put it into ThisString find it in background field "Sub Accounts" put 0 into Test put 0 into Total put 0 into LineNumber repeat until Flag add 1 to LineNumber put length of line LineNumber of background field "Sub Accounts" into Len add 1 to Len put Len + Total into Total put offset (it, background field "Sub Accounts") into ThisOffset if ThisOffset < Total then --ask "Is this the line? " with LineNumber get line LineNumber of background field "Sub Accounts" if it is ThisString then exit CloseField else ask "Do you mean..." with it if it is "" then beep click at the loc of background field id ThisField exit closeField else put it into background field id ThisField put True into Flag end if end if end if end repeat end closefield -- part 92 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=148 top=202 right=216 bottom=253 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub Amt ----- HyperTalk script ----- on openField Global ThisField put 92 into ThisField put ThisField-5 into ThisNameField if background field id ThisNameField is empty then click at the loc of background field id ThisNameField end if end openField on closeField Global Amount set numberformat to 0.00 put 92 into FieldNumber put FieldNumber-5 into NameFieldNumber get background field "Amount" put the value of it into Amount get background field ID FieldNumber if it is not empty then if it contains "%" then delete last char of it put the value of it/100*Amount into background field ID FieldNumber end if add 0 to background field id FieldNumber end if put 0 into Total repeat with i = 92 to 95 if background field id i is not empty then add the value of background field id i to Total end repeat put Amount - Total into background field id 96 end closeField -- part 93 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=148 top=215 right=229 bottom=253 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub Amt ----- HyperTalk script ----- on openField Global ThisField put 93 into ThisField put ThisField-5 into ThisNameField if background field id ThisNameField is empty then click at the loc of background field id ThisNameField end if end openField on closeField Global Amount set numberformat to 0.00 put 93 into FieldNumber put FieldNumber-5 into NameFieldNumber get background field "Amount" put the value of it into Amount get background field ID FieldNumber if it is not empty then if it contains "%" then delete last char of it put the value of it/100*Amount into background field ID FieldNumber end if add 0 to background field id FieldNumber end if put 0 into Total repeat with i = 92 to 95 if background field id i is not empty then add the value of background field id i to Total end repeat put Amount - Total into background field id 96 end closeField -- part 94 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=148 top=228 right=242 bottom=253 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub Amt ----- HyperTalk script ----- on openField Global ThisField put 94 into ThisField put ThisField-5 into ThisNameField if background field id ThisNameField is empty then click at the loc of background field id ThisNameField end if end openField on closeField Global Amount set numberformat to 0.00 put 94 into FieldNumber put FieldNumber-5 into NameFieldNumber get background field "Amount" put the value of it into Amount get background field ID FieldNumber if it is not empty then if it contains "%" then delete last char of it put the value of it/100*Amount into background field ID FieldNumber end if add 0 to background field id FieldNumber end if put 0 into Total repeat with i = 92 to 95 if background field id i is not empty then add the value of background field id i to Total end repeat put Amount - Total into background field id 96 end closeField -- part 95 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=148 top=241 right=255 bottom=253 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub Amt ----- HyperTalk script ----- on openField Global ThisField put 95 into ThisField put ThisField-5 into ThisNameField if background field id ThisNameField is empty then click at the loc of background field id ThisNameField end if end openField on closeField Global Amount set numberformat to 0.00 put 95 into FieldNumber put FieldNumber-5 into NameFieldNumber get background field "Amount" put the value of it into Amount get background field ID FieldNumber if it is not empty then if it contains "%" then delete last char of it put the value of it/100*Amount into background field ID FieldNumber end if add 0 to background field id FieldNumber end if put 0 into Total repeat with i = 92 to 95 if background field id i is not empty then add the value of background field id i to Total end repeat put Amount - Total into background field id 96 end closeField -- part 96 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=148 top=254 right=268 bottom=253 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Sub Amt5 ----- HyperTalk script ----- on mouseLeave Global Amount set numberformat to 0.00 get background field "Amount" if it is not empty then if background field id 96 is not empty then add 0 to background field id 96 put the value of it into Amount put 0 into Total end if end mouseLeave -- part 108 (button) -- low flags: 00 -- high flags: A003 -- rect: left=15 top=280 right=302 bottom=96 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Accept ----- HyperTalk script ----- on mouseUp Global LastID, ShortGivingDate, ThisID, Amount, LName, ThisField set numberformat to 0.00 if background field "Amount" is empty then answer "You forgot to enter an amount!" with "OK" exit mouseUp end if if background field ID 130 is empty then answer "You forgot to enter the name into the key name field!" with "OK" exit mouseUp end if if ThisField > 91 and ThisField < 97 then send closeField to background field ID ThisField end if if the value of background field "Sub Amt5" is Amount then answer "Are you sure you want all this amount to go into " & "the MISCELLANEOUS Sub Account?" with "No" or "Yes" if it is "No" then exit mouseUp end if put "Updating this income entry...." into line 2 of background field "Form Pop" show background field "Form Pop" set lockscreen to true hide background field "Form Pop" put empty into background field "Form pop" set cursor to 4 put background field "Key Field" into KeyField put background field "Memo" into Memo put background field "Last Name" into LName put LName into CheckLName put the ID of this card into LastID set lockscreen to true put KeyField & "-" & shortGivingDate into ThisName go to card ThisName of background "Income Record" if the result is empty then beep get background field "Amount" answer "You have already made at least one entry for this account on this date for $ " & it with "View it" or "Make New" or "CANCEL" if it is "Cancel" then go to LastID set lockscreen to false exit mouseUp end if if it is "View it" then set lockscreen to false exit mouseUp end if end if add Amount to background field "YTD Total" put background field "YTD Total" into YTD go to last card of background "Income Record" doMenu "New Card" put the ID of this Card into NewID put Amount into background field "Amount" put Memo into background field "Memo" set the name of this card to ThisName put LName into background field "Last Name" put KeyField into background field "Key Field" put shortGivingDate into background field "Date" put YTD into background field "YTD Total" repeat with i = 1 to 10 put 86+i into ThisID1 put 32+i into ThisID2 go to LastID put background field ID ThisID1 into subItem go to NewID put subItem into background field ID ThisID2 end repeat put 0 into i go to card "Main" of background "Income" repeat forever add 1 to i get line i of card field "Totals" if it is empty then put shortGivingDate & " $ " & Amount into line i of card field "Totals" exit repeat else if word 1 of it is shortGivingDate then put word 3 of it into Balance add Amount to Balance put shortGivingDate & " $ " & Balance into line i of card field "Totals" exit repeat end if end if end repeat go to LastID send "CreditSubs" to background send "ResetFields" to background put shortGivingDate & " " & Amount into background field "Last Entry" --play boing c set lockscreen to false end mouseUp -- part 109 (button) -- low flags: 00 -- high flags: A003 -- rect: left=14 top=305 right=327 bottom=95 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Clear ----- HyperTalk script ----- on mouseUp Global LimitCards1, LimitCards2 set cursor to 4 set lockscreen to true send "ResetFields" to background end mouseUp -- part 112 (field) -- low flags: 01 -- high flags: 4000 -- rect: left=358 top=20 right=37 bottom=478 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: YTD Total ----- HyperTalk script ----- on mouseUp2 Global Correction set numberformat to 0.00 get background field "YTD Total" put it into YTD if Correction is empty then put 0 into Correction add 0 to Correction put YTD + Correction into NewYTD ask "Would you like to modify this YTD Total by: $" & Correction & "? This would make the new balance equal to $" & NewYTD & " Click OK or enter the actual YTD Total." with NewYTD if it is empty then exit mouseUp add 0 to it put it into background field "YTD Total" end mouseUp2 -- part 113 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=463 top=287 right=328 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 29114 / 29114 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Daily ----- HyperTalk script ----- on mouseUp go to card "Main" of background "Income" end mouseUp -- part 115 (button) -- low flags: 00 -- high flags: 2006 -- rect: left=479 top=18 right=36 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New Button ----- HyperTalk script ----- on mouseUp global LastField set the hilite of Background button ID 115 to false put "YTD Total" into LastField end mouseUp -- part 118 (button) -- low flags: 00 -- high flags: 0004 -- rect: left=204 top=288 right=329 bottom=243 -- title width / last selected line: 0 -- icon id / first selected line: 8538 / 8538 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SuperFind: Chris Hostetter ----- HyperTalk script ----- on mouseUp -- Super Find -- by Chris Hostetter, Mac Help Co., 1800 East Market Street -- Long Beach, CA 90805, (213) 428-7414 -- This script and portions of it may be used and modified -- provided that you also include these credit lines global LastButton, searchstring, LastField get the selection if it is not empty then put it into SearchString put the name of the target into ThisOne set hilite of thisOne to true put "Chars" into FindType put empty into SearchLimit ask "Find Word(s)? Hold option key for limits." with SearchString set hilite of thisOne to false if it is empty then exit mouseUp end if put it into SearchString if the OptionKey is down then if LastField is not empty then Answer "Search for information in what field?" with "Cancel" or LastField or "Any Field" if it is "Cancel" Then exit mouseUp end if if it is LastField then put " in background field " & NumToChar(34) & it & NumToChar(34) into SearchLimit else put "" into SearchLimit end if end if Answer "Find " & FindType & " '" & Searchstring & "'" with "Begins With" or "Full Word" or "These Chars" if it is "Begins with" then put empty into FindType if it is "Full Word" then put "Word" into FindType if it is "These Chars" then put "Chars" into FindType end if set loc of message box to 20,-50 put "Find" && FindType && Quote & SearchString & Quote & SearchLimit into message box hide message box set loc of message box to 20,300 do message box if the result is "Not Found" then beep answer FindType && "'" & SearchString & "' not found. Search more?" with "No" or "Yes" if it is "Yes" then click at the loc of the name of the target end if end mouseUp -- part 119 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=294 top=38 right=58 bottom=334 -- title width / last selected line: 0 -- icon id / first selected line: 22308 / 22308 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Super Find ----- HyperTalk script ----- on mouseUp Global LastID, FindString, Report, ClearedActivity, IncomeCardID if the optionKey is down then put "This button will take you directly to the individual" && "transactions for this client. Keep clicking the arrow to view" && "each transaction for this client." into String put the name of the target into ThisItem HelpMsg2 String, ThisItem exit mouseUp end if put background field "Last Name" into LName put background field "Key Field" into SearchString put background field "Key Field" into FindString if SearchString is empty then go to card "Main" of background "Income Record" exit mouseUp end if put the ID of this card into IncomeCardID put the ID of this card into LastID set lockscreen to true go to card "Main" of background "Income Record" set loc of message box to 20,-50 put "Find word" && Quote & SearchString & Quote && "in background field" && Quote & "Key Field" & Quote into message box hide message box set loc of message box to 20,300 set lockscreen to true set cursor to 4 repeat until background field "Key Field" is FindString put false into ClearedActivity do message box if the result is "Not Found" then if Report is not true then beep answer "Activity for '" & LName & "' must have been cleared already. Could not find any records." end if put true into ClearedActivity go to LastID exit repeat end if end repeat set lockscreen to false end mouseUp -- part 129 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=102 top=23 right=40 bottom=328 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 128 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: First Names ----- HyperTalk script ----- on openfield global LastField put "Last Name" into LastField end openfield on closeField get background field "Last Name" set the name of this card to it end closeField -- part 130 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=102 top=39 right=56 bottom=298 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 128 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: Last Name ----- HyperTalk script ----- on openfield global LastField, LName put "Last Name" into LastField put background field "Last Name" into LName if LName is empty then put "Last 'Empty'" into LastField end if end openfield on closeField Global LastField, LName set numberFormat to 00000000000 put background field "Last Name" into NewLast put random(1000000000) into RandKey add 0 to RandKey put the length of NewLast into TotalChars repeat with i = 1 to TotalChars if last char of NewLast is " " then delete last char of newLast else exit repeat end if end repeat if the length of NewLast is 0 then answer "You must enter something for the key field" end if put NewLast into background field "Last Name" put NewLast & RandKey into NewKey if LastField is "Last 'Empty'" then else answer "Because you are changing the Last Name, " & LName & "'s " & "daily income cards will have to be updated as well." with "Update" or "Cancel" if it is "Cancel" then put LName into background field "Last Name" exit closeField end if set lockscreen to true put background field "Key Field" into SearchString put the ID of this card into ThisID go to card "Main" of background "Income Record" set loc of message box to 20,-50 put "Find word" && Quote & SearchString & Quote && "in background field" && Quote & "Key Field" & Quote into message box hide message box set loc of message box to 20,300 do message box repeat until the result is "Not Found" do message box if the result is empty then put NewKey into background field "Key field" put NewLast into background field "Last Name" get background field "Date" put NewKey & "-" & it into ThisName set the name of this card to ThisName end if end repeat go to ThisID end if set the name of this card to NewKey put NewLast & RandKey into background field "Key Field" set lockscreen to false end closeField -- part 131 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=102 top=62 right=96 bottom=328 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 128 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: Address1 ----- HyperTalk script ----- on openfield global LastField put "Address1" into LastField end openfield -- part 132 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=102 top=95 right=113 bottom=328 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 128 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: City State Zip ----- HyperTalk script ----- on openfield global LastField put "Address2" into LastField end openfield -- part 133 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=102 top=112 right=129 bottom=328 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 128 -- text size: 12 -- style flags: 16640 -- line height: 16 -- part name: Phone ----- HyperTalk script ----- on openfield global LastField put "Phone" into LastField end openfield -- part 135 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=144 top=148 right=165 bottom=303 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Amount ----- HyperTalk script ----- on OpenField Global ThisField put empty into ThisField end OpenField on CloseField Global Amount, TransName, BeginAmt put Amount into LastAmount set numberformat to 0.00 get background field "Amount" if it is not empty then put the value of it into Amount add 0 to Amount put Amount into background field "Amount" put 0 into Total repeat with i = 92 to 95 if background field id i is not empty then add the value of background field id i to Total end repeat put Amount - Total into background field ID 96 end if end CloseField on mouseLeave CloseField end mouseLeave -- part 137 (field) -- low flags: 01 -- high flags: 4000 -- rect: left=358 top=52 right=66 bottom=478 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Last Entry -- part 138 (field) -- low flags: 80 -- high flags: 0004 -- rect: left=0 top=122 right=141 bottom=362 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Key Field -- part 139 (button) -- low flags: 00 -- high flags: A002 -- rect: left=64 top=148 right=165 bottom=141 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: 1/1/88 ----- HyperTalk script ----- on MouseUp Global DatePhrase, ExitFlag, ShortGivingDate put "Do you wish to change the date of this entry from: " & "                                    " into DatePhrase put False into ExitFlag send "DoDate" to background if exitFlag is true then exit mouseUp end if set the name of background button ID 139 to ShortGivingDate end mouseUp -- part 140 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=64 top=168 right=197 bottom=303 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Memo -- part 141 (field) -- low flags: 80 -- high flags: 0004 -- rect: left=43 top=92 right=285 bottom=465 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 18 -- style flags: 256 -- line height: 24 -- part name: Form Pop -- part 142 (button) -- low flags: 80 -- high flags: 4000 -- rect: left=310 top=154 right=166 bottom=481 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Hilighter ----- HyperTalk script ----- on mouseUp hide background button "Hilighter" click at the loc of background button "Hilighter" end mouseUp -- part 143 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=161 top=288 right=329 bottom=200 -- title width / last selected line: 0 -- icon id / first selected line: 1004 / 1004 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ImageWriter Statement ----- HyperTalk script ----- on mouseUp Global Report, ClearedActivity, LastID if the optionKey is down then put "This will generate full report for clients in your" && "database. It can be used for a receipt for the clients and" && "it will include the total amount given, plus the individual" && "amounts given and the dates they were given on." into String put the name of the target into ThisItem HelpMsg2 String, ThisItem exit mouseUp end if answer "Do you wish to print a full statement for DataBase clients?" with "Cancel" or "Yes" if it is "Cancel" then exit mouseUp put true into report answer "Generate printed report for All clients or this one only?" with "Cancel" or "This One" or "All" if it is "Cancel" then exit mouseUp put it into doHowMany put the ID of this card into BeganCardID answer "Include Name Field" with "No" or "Yes" put false into ID129Field if it is "Yes" then put true into ID129Field answer "Include Address Field" with "No" or "Yes" put false into ID131Field if it is "Yes" then put true into ID131Field answer "Include City, State, Zip Field" with "No" or "Yes" put false into ID132Field if it is "Yes" then put true into ID132Field answer "Include Phone Field" with "No" or "Yes" put false into ID133Field if it is "Yes" then put true into ID133Field answer "Enter a message / comment header?" with "No" or "Yes" put empty into Comment if it is "Yes" then ask "What is your message or comment Header?" put it into comment end if answer "Include Year To Date Amount Field" with "No" or "Yes" put false into ID112Field if it is "Yes" then put true into ID112Field --answer "Give each client their own printed page on the printout?" --with "Yes" or "No" --if it is "Yes" then --put True into AddBlanks --else put False into AddBlanks --end if if the ID of this card is "Card ID 6137" then go to next card of this background end if put "Please wait - Generating Income Statements. This will take a while." into line 2 of background field "Form Pop" show background field "Form Pop" put 1 into TotalCards set lockscreen to true hide background field "Form Pop" put empty into background field "Form Pop" if doHowMany is "All" then go to first card of background "Income" put the number of this card into firstCard go to last card of background "Income" put the number of this card into lastCard put LastCard - FirstCard into TotalCards go to card 2 of background "Income" end if repeat with ii = 1 to TotalCards put "Please wait - Generating Income Statements. This will" && "take a while." into line 2 of background field "Form Pop" put "Retrieving information for" && Background field ID 130 into line 3 of background field "Form Pop" put "Client Number." & ii into line 5 of background field "Form Pop" show background field "Form Pop" set lockscreen to false set lockscreen to true hide background field "Form Pop" put empty into background field "Form Pop" put empty into ReportName if ID129Field is true then put Reportname & background field ID 129 & Return into ReportName end if if ID131Field is true then put Reportname & background field ID 131 & Return into ReportName end if if ID132Field is true then put Reportname & background field ID 132 & Return into ReportName end if if ID133Field is true then put Reportname & background field ID 133 & Return into ReportName end if put Return & ReportName & Comment & Return into ReportName if ID112Field is true then put Reportname & "$ " & background field ID 112 into ReportName end if click at the loc of background button "Super Find" put the ID of this card into ReturnToID set lockscreen to true if ClearedActivity is false then put the ID of this Card into FirstOfSeriesID if background field ID 32 is empty then --beep --answer "Found a record with no Key Name field!" go to ReturnToID exit repeat end if go to last card of background "Donor Reports" doMenu "New Card" put ReportName into line 1 of background field "Name" go to ReturnToID put 0 into i repeat forever add 1 to i put background field "Date" into ReportDate put background field "Amount" into ReportAmount go to last card of background "Donor Reports" put ReportDate into line i of background field "Date" put ReportAmount into line i of background field "Amount" go to ReturnToID repeat with j = 33 to 37 put j+5 into JJ get background field ID JJ if it is not empty then put the value of it into it if it is not 0 then add 1 to i put background field ID J into SubName put background field ID JJ into SubAmt go to last card of background "Donor Reports" put Tab & "»" & SubName & Tab & SubAmt into line i of background field "Amount" put " " into line i of background field "Date" go to ReturnToID end if end if end repeat go to last card of background "Donor Reports" add 1 to i Put " " into line i of background field "Date" Put " " into line i of background field "Amount" add 1 to i Put " " into line i of background field "Date" Put " " into line i of background field "Amount" go to ReturnToID click at the loc of background button "Super Find" put the ID of this card into ReturnToID if the ID of this card is FirstOfSeriesID then if addBlanks then -- go to new page add 1 to i -- 56 is the number of printlines per page in column layout put 56 into PrintLines put i / PrintLines into PageNumber put round(PageNumber) into RoundPageNumber if RoundPageNumber is 0 then put 1 into RoundPageNumber if RoundPageNumber > PageNumber then put (RoundPageNumber * PrintLines) into lastLine else put ((RoundPageNumber * PrintLines) + 1) into LastLine end if go to last card of background "Donor Reports" repeat with k = i to LastLine Put " " into line k of background field "Amount" end repeat Put "-end of listing- " into line LastLine of background field "Amount" end if -- add blanks go to ReturnToID exit repeat end if -- Exit this donor name and find a new one *** end repeat end if set lockscreen to True go to LastID go to next card of background "Income" end repeat put false into report go to first card of background "Donor Reports" doMenu "Delete Card" set lockscreen to true --click at the loc of background button "Print" --go to BeganCardID --end print routine, return to card where called exit mouseUp set lockscreen to false end mouseUp -- part 144 (field) -- low flags: 81 -- high flags: 2004 -- rect: left=50 top=45 right=310 bottom=470 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Help Message Field ----- HyperTalk script ----- on mouseUp set cursor to 4 put the name of the target into thisField do "put empty into" && thisField hide thisField end mouseUp